package top.ochiamalu.aioj.util.model;

import lombok.Data;

/**
 * ai响应
 *
 * @author ochiamalu
 * @date 2025/03/05
 */
@Data
public class AIResponse {
    /**
     * ID
     */
    private String id;

    /**
     * 对象
     */
    private String object;

    /**
     * 创建
     */
    private long created;

    /**
     * 模型
     */
    private String model;

    /**
     * 使用
     */
    private Usage usage;

    /**
     * 选择
     */
    private Choice[] choices;

    private String system_fingerprint;

    @Data
    public static class Usage {
        /**
         * 使用量
         */
        private int prompt_tokens;

        /**
         * 完成量
         */
        private int completion_tokens;

        /**
         * 总用量
         */
        private int total_tokens;

        private PromptTokensDetails prompt_tokens_details;
        private CompletionTokensDetails completion_tokens_details;
        private int prompt_cache_hit_tokens;
        private int prompt_cache_miss_tokens;
    }

    @Data
    public static class Choice {
        /**
         * 消息
         */
        private Message message;

        /**
         * 指数
         */
        private int index;

        /**
         * 完成原因
         */
        private String finish_reason;

        private Object logprobs;
    }

    @Data
    public static class PromptTokensDetails {
        private int cached_tokens;
    }

    @Data
    public static class CompletionTokensDetails {
        private int reasoning_tokens;
    }
} 